package com.example.server.service.impl;

import com.example.server.entity.Rating;
import com.example.server.mapper.RatingMapper;
import com.example.server.service.RatingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RatingServiceImpl implements RatingService {

    @Autowired
    private RatingMapper ratingMapper;

    @Override
    public void submitRating(Rating rating) {
        ratingMapper.insertRating(rating);
        ratingMapper.updateOverallRating(rating.getIdbook());
    }
}
